<template>
  <div class="history_wrapper">
      <pad-child-header :title="title"></pad-child-header>
      <section class="">
          <ul class="history_content">
              <li v-for="(v,i) in filmMsg" :key="i" class="m_b_16" @click="goTouserFilmDetail(params)">
                  <div class="history_title ">
                      <img src="@/assets/images/y.png" alt="">
                      <p>
                          {{v.TC_ST_CHK_TIME}}
                      </p>
                  </div>
                  
                  <div class="history_item">
                    <p >胶片数：{{v.filmCount?v.filmCount:'0'}}     序列数：{{v.photoCount}}</p>
                    <p class="">{{v.TC_ST_TYPE}} {{v.TC_ST_BODY}}</p>
                    <p class="font_overflow" style="width: 95%;">{{v.TC_RP_FINDINGS}}</p>
                      <p class="font_overflow" style="width: 95%;">{{v.TC_RP_INSPECT_CON}}</p>
                  </div>
                  <div class="history_btns c_fff">
                      <div @click.stop="goToImgAndText(1)">
                          图文报告
                      </div>
                      <div  @click.stop="goToElectronicFilm(2)">
                          电子胶片
                      </div>
                      <div  @click.stop="goToImageBrowsing(3)">
                          影像浏览
                      </div>
                  </div>
              </li>
              
          </ul>
      </section>
  </div>
</template>

<script>
import { HttpService } from "../../provides/index";
export default {
  components: {},
  props: {},
  data() {
    return {
      title: "历史检查",
      params: {},
      filmMsg:[]
    };
  },
  watch: {},
  computed: {},
  methods: {
    goTouserFilmDetail(params) {
        this.$router.push({ path: "/userDetail/"+params.studyid+'/'+params.hospcode+'/'+params.patientid + '/' + params.hospdomain});
    },
    goToImgAndText(params) {
        this.$router.push({ path: "/ImgAndTextApt/"+params.studyid+'/'+params.hospcode+'/'+params.patientid + '/' + params.hospdomain});
    },
    goToElectronicFilm(params) {
        this.$router.push({ path: "/ElectronicFilmApt/"+params.studyid+'/'+params.hospcode+'/'+params.patientid + '/' + params.hospdomain});
    },
    goToImageBrowsing(params) {
        this.$router.push({ path: "/ImageBrowsingApt/"+params.studyid+'/'+params.hospcode+'/'+params.patientid + '/' + params.hospdomain});
    }
  },
  created() {},
  mounted() {
      this.params = {
      patientid: this.$route.params.patientid,
      studyid: this.$route.params.studyid,
      hospcode: this.$route.params.hospcode,
      hospdomain: this.$route.params.hospdomain,
    };
    HttpService.api({
      url: "/history",
      params: this.params,
      headers: {}
    })
      .then(res => {
        
        this.filmMsg = res.result || {};
        console.log(this.filmMsg)
      })
      .catch(err => {
        console.log(err);
      });
  }
};
</script>
<style lang="scss" scoped>
.wrapper {
}
.history_content {
  color: rgb(115, 115, 115);
  padding: pxToRem(70) pxToRem(21) pxToRem(20) pxToRem(20);
  > li {
    border: 1px solid #b7b7b7;
    border-radius: pxToRem(10);
    box-shadow: pxToRem(3) pxToRem(4) pxToRem(5) 0 rgba(0, 0, 0, 0.29);
    padding: pxToRem(20) 0 pxToRem(10) 0;
    background: rgb(242, 242, 242);
    .history_title {
      display: flex;
      padding-left: pxToRem(22);
      align-items: center;
      font-size: pxToRem(10);
      img {
        width: pxToRem(10);
        height: pxToRem(10);
        padding-right: pxToRem(8);
      }
    }
    .history_item {
      margin-bottom: pxToRem(13);
      font-size: pxToRem(10);
      padding: pxToRem(4) pxToRem(26) 0 pxToRem(40);

      p {
        line-height: pxToRem(20);
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
      }
    }
    .history_btns {
      display: flex;
      justify-content: space-around;
      width: pxToRem(365);
      margin: 0 auto;
      div {
        border-radius: pxToRem(3);
        width: pxToRem(80);
        height: pxToRem(25);
        font-size: pxToRem(10);
        text-align: center;
        line-height: pxToRem(25);
        border: solid 1px #5b8637;
        background: rgb(127, 181, 83);
      }
    }
  }
}
</style>